angular.module('app.routes', [])
    .config(function ($stateProvider, $urlRouterProvider, $ionicConfigProvider) {
        $ionicConfigProvider.navBar.alignTitle('center');
        $ionicConfigProvider.views.maxCache(100);

//---------------------------------默认启动状态---------------------------------------------------------------------

        // if none of the above states are matched, use this as the fallback
        $urlRouterProvider.otherwise('/main');

//-------------------------以下是公共的状态-------------------------------------------------------------------------
        $stateProvider

            .state('main', {
                url: '/main',
                templateUrl: 'templates/main/main.html',
                controller: 'mainCtrl'
            })

            .state('app', {
                url: '/app',
                abstract: true,
                templateUrl: 'templates/main/menu.html',
                controller: 'AppCtrl'
            })


            //-------------------------------------- 左侧列表----------------------------------------
            .state('app.home', {
                url: '/home',
                views: {
                    'menuContent': {
                        templateUrl: 'templates/main/home.html',
                        controller: 'homeCtrl'
                    }
                }
            })

            .state('app.about', {
                url: '/about',
                views: {
                    'menuContent': {
                        templateUrl: 'templates/main/about.html',
                        controller: 'aboutCtrl'
                    }
                }
            })
            .state('app.login', {
                url: '/login',
                views: {
                    'menuContent': {
                        templateUrl: 'templates/main/login.html',
                        controller: 'mainCtrl'
                    }
                }
            })
            .state('app.showtime', {
                url: '/showtime',
                views: {
                    'menuContent': {
                        templateUrl: 'templates/main/showtime.html',
                        controller: 'showtimeCtrl'
                    }
                }
            })
            .state('app.editTime', {
                url: '/editTime',
                views: {
                    'menuContent': {
                        templateUrl: 'templates/main/editTime.html',
                        controller: 'showtimeCtrl'
                    }
                }
            })

            .state('app.resetPwd', {
                url: '/resetPwd',
                views: {
                    'menuContent': {
                        templateUrl: 'templates/main/resetPwd.html',
                        controller: 'mainCtrl'
                    }
                }
            })


            .state('app.tag',{
                url:'/tag',
                views:{
                    'menuContent': {
                        templateUrl: 'templates/main/tag.html',
                        controller: 'tagCtrl'
                    }

                }
            })
            //-------------------------------------- 编辑时间----------------------------------------


            .state('app.Monday', {
                url: '/Monday',
                views: {
                    'menuContent': {
                        templateUrl: 'templates/main/Monday.html',
                        controller: 'weekCtrl'
                    }
                }
            })
            .state('app.Tuesday', {
                url: '/Tuesday',
                views: {
                    'menuContent': {
                        templateUrl: 'templates/main/Tuesday.html',
                        controller: 'weekCtrl'
                    }
                }
            })
            .state('app.Wednesday', {
                url: '/Wednesday',
                views: {
                    'menuContent': {
                        templateUrl: 'templates/main/Wednesday.html',
                        controller: 'weekCtrl'
                    }
                }
            })
            .state('app.Thursday', {
                url: '/Thursday',
                views: {
                    'menuContent': {
                        templateUrl: 'templates/main/Thursday.html',
                        controller: 'weekCtrl'
                    }
                }
            })
            .state('app.Friday', {
                url: '/Friday',
                views: {
                    'menuContent': {
                        templateUrl: 'templates/main/Friday.html',
                        controller: 'weekCtrl'
                    }
                }
            })
            .state('app.Saturday', {
                url: '/Saturday',
                views: {
                    'menuContent': {
                        templateUrl: 'templates/main/Saturday.html',
                        controller: 'weekCtrl'
                    }
                }
            })
            .state('app.Sunday', {
                url: '/Sunday',
                views: {
                    'menuContent': {
                        templateUrl: 'templates/main/Sunday.html',
                        controller: 'weekCtrl'
                    }
                }
            })




            //-------------------------------------- 用户个人界面----------------------------------------

            .state('app.user', {
                url: '/user',
                views: {
                    'menuContent': {
                        templateUrl: 'templates/user/user.html',
                        controller: 'userCtrl'
                    }
                }
            })



            //-------------------------------------- 管理员界面---------------------------------------
            .state('app.showTimeForAll', {
                url: '/showTimeForAll',
                views: {
                    'menuContent': {
                        templateUrl: 'templates/admin/showTimeForAll.html',
                        controller: 'showTimeForAllCtrl'
                    }
                }
            })

            .state('app.groupMember', {
                url: '/groupMember',
                views: {
                    'menuContent': {
                        templateUrl: 'templates/admin/groupMember.html',
                        controller: 'groupMemberCtrl'
                    }
                },
                params: {//跳转设置参数
                    _id: null,
                    name: null
                }
            })

            .state('app.addGroupMember', {
                url: '/addGroupMember',
                views: {
                    'menuContent': {
                        templateUrl: 'templates/admin/addGroupMember.html',
                        controller: 'addGroupMemberCtrl'
                    }
                },
                params: {//跳转设置参数
                    _id: null,
                    name: null
                }
            })

            .state('app.GroupAdmin', {
                url: '/GroupAdmin',
                views: {
                    'menuContent': {
                        templateUrl: 'templates/admin/GroupAdmin.html',
                        controller: 'GroupAdminCtrl'
                    }
                }
            })

            .state('app.showTimeForDay', {
                url: '/showTimeForDay/:weekday',
                views: {
                    'menuContent': {
                        templateUrl: 'templates/admin/showTimeForDay.html',
                        controller: 'showTimeForDayCtrl'
                    }
                }
            })

            .state('app.showTimeForPeriod', {
                url: '/showTimeForPeriod',
                views: {
                    'menuContent': {
                        templateUrl: 'templates/admin/showTimeForPeriod.html',
                        controller: 'showTimeForPeriodCtrl'
                    }
                },
                params: {args: {}}
            })

            .state('app.addGroup', {
                url: '/addGroup',
                views: {
                    'menuContent': {
                        templateUrl: 'templates/admin/addGroup.html',
                        controller: 'addGroupCtrl'
                    }
                }
            })
            .state('app.deleteGroup', {
                url: '/deleteGroup',
                views: {
                    'menuContent': {
                        templateUrl: 'templates/admin/deleteGroup.html',
                        controller: 'deleteGroupCtrl'
                    }
                }
            });


    });



